package com.aki.ai_property.controller;

import com.aki.ai_property.dto.AdviseHouseholderDto;
import com.aki.ai_property.service.intf.AdviseHouseholderDtoService;
import com.aki.ai_property.vo.PageBean;
import com.aki.ai_property.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ━━━━━━永无BUG!━━━━━━
 *
 * @author AKI
 * @date 2022/8/30
 */
@RestController
@RequestMapping("/api/ahd/")
public class AdviseHouseholderDtoController {
    @Autowired
    private AdviseHouseholderDtoService service;

    @PostMapping("save.do")
    public Result save(AdviseHouseholderDto adviseHouseholderDto){
        return service.save(adviseHouseholderDto);
    }
    @PostMapping("update.do")
    public Result update(AdviseHouseholderDto adviseHouseholderDto){
        return service.update(adviseHouseholderDto);
    }
    @GetMapping("all.do")
    public PageBean page(String name, int page, int limit){
        return service.selectPage(name,page,limit);
    }
    @GetMapping("delete.do")
    public Result delete(Integer id){
        return service.delete(id);
    }
}
